package com.cpe.web.intercepter.global.pre;

import static com.sql.data.response.CommonRespCode.UNKNOWN_SOURCE;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cpe.web.intercepter.base.AbstractInterceptor;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ReqHeaderInterceptor extends AbstractInterceptor {

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		String source = request.getHeader("Source");
		log.info("source=" + source);
		if (source == null) {
			return end(response, UNKNOWN_SOURCE);
		}
		return GO_ON;
	}

}
